home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / npfobs12 / usercont.ctl < prev   
Encoding:
Text File  |  1999-02-02  |  3.0 KB  |  134 lines

  1. VERSION 5.00
  2. Begin VB.UserControl UserControl1 
  3.    AutoRedraw      =   -1  'True
  4.    ClientHeight    =   705
  5.    ClientLeft      =   0
  6.    ClientTop       =   0
  7.    ClientWidth     =   4800
  8.    ScaleHeight     =   705
  9.    ScaleWidth      =   4800
  10.    Begin VB.Timer Timer1 
  11.       Enabled         =   0   'False
  12.       Interval        =   200
  13.       Left            =   2160
  14.       Top             =   240
  15.    End
  16.    Begin VB.Label Label2 
  17.       BackStyle       =   0  'Transparent
  18.       Caption         =   "1.2"
  19.       Height          =   255
  20.       Left            =   0
  21.       TabIndex        =   1
  22.       Top             =   0
  23.       Width           =   855
  24.    End
  25.    Begin VB.Label Label1 
  26.       Appearance      =   0  'Flat
  27.       AutoSize        =   -1  'True
  28.       BackColor       =   &H80000005&
  29.       BackStyle       =   0  'Transparent
  30.       BeginProperty Font 
  31.          Name            =   "Times New Roman"
  32.          Size            =   18
  33.          Charset         =   0
  34.          Weight          =   700
  35.          Underline       =   0   'False
  36.          Italic          =   0   'False
  37.          Strikethrough   =   0   'False
  38.       EndProperty
  39.       ForeColor       =   &H80000008&
  40.       Height          =   390
  41.       Left            =   120
  42.       TabIndex        =   0
  43.       Top             =   120
  44.       Width           =   90
  45.    End
  46. End
  47. Attribute VB_Name = "UserControl1"
  48. Attribute VB_GlobalNameSpace = False
  49. Attribute VB_Creatable = True
  50. Attribute VB_PredeclaredId = False
  51. Attribute VB_Exposed = True
  52.  
  53.     Dim m_Speed
  54.  
  55. Private Sub Timer1_Timer()
  56.     Dim i As Integer
  57.     
  58.     Label1.Left = Label1.Left - 2 * Screen.TwipsPerPixelX
  59.     If (Label1.Left + Label1.Width < 0) Then
  60.         Label1.Left = Width
  61.     End If
  62. End Sub
  63.  
  64. Private Sub UserControl_Initialize()
  65.  
  66.     Dim i As Integer
  67.     Dim fn As Integer
  68.     Dim str1 As String
  69.     
  70.     fn = FreeFile
  71.     
  72. '   Open the data file.
  73.     Open "c:\fobsax.fbs" For Input As #fn
  74.     
  75. '   Skip my name (Project1.UserControl1)
  76.     Line Input #fn, str1
  77.     
  78. '   Skip line 2 (reserved for future use).
  79.     Line Input #fn, str1
  80.     
  81. '   Read the tip of the day.
  82.     Line Input #fn, str1
  83.     
  84.     Close #fn
  85.     Label1 = str1
  86.     Label1.Left = Width
  87.     
  88.     GetProperties
  89.     
  90.     Timer1.Enabled = True
  91.     If (IsNumeric(speed)) Then
  92.         Timer1.Interval = Timer1.Interval / speed
  93.     End If
  94.  
  95. End Sub
  96.  
  97. Property Let FontSize(newFontSize)
  98.  
  99.     On Error Resume Next
  100.     Label1.FontSize = newFontSize
  101.     
  102. End Property
  103.  
  104. Property Get FontSize()
  105.  
  106.     FontSize = Label1.FontSize
  107.     
  108. End Property
  109.  
  110. Property Let speed(newSpeed)
  111.  
  112.     If (newSpeed >= 1 And newSpeed <= 4) Then
  113.         m_Speed = newSpeed
  114.     End If
  115.  
  116. End Property
  117.  
  118. Property Get speed()
  119.  
  120.     speed = m_Speed
  121.     
  122. End Property
  123.  
  124. Sub GetProperties()
  125.  
  126.     Dim i As Integer
  127.     Dim str1 As String
  128.     Dim rc As Long
  129.     
  130.     speed = GetPropertyFromFBS("Speed", "4")
  131.     FontSize = GetPropertyFromFBS("FontSize", "16")
  132.     
  133. End Sub
  134.